<%@ page errorPage="error.jsp" contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" %>

<% Class.forName("oracle.jdbc.OracleDriver"); %>

<html>
<head>

</head>
<body>


 <% 
	
	

            Connection connection = DriverManager.getConnection( "jdbc:oracle:thin:@localhost:1521:xe", "SEPROJECT", "123456");

            Statement statement = connection.createStatement() ;

        int id = Integer.valueOf(request.getParameter("prod_id"));
        String name = request.getParameter("prod_name");
        String category = request.getParameter("prod_cat");
        String description = request.getParameter("description");
        int stock_qty = Integer.valueOf(request.getParameter("stock_qty"));
        int reorder_qty = Integer.valueOf(request.getParameter("reorder_qty"));

	 String queryText = "insert into PRODUCT (\"ID\", \"NAME\", \"CATEGORY\", \"DESCRIPTION\", \"STOCK_QTY\", \"REORDER_QTY\") values('"+id+"','"+name+"','"+category+"','"+ description+"','"+stock_qty+"','"+reorder_qty+"')";

	ResultSet rst = statement.executeQuery(queryText);

            rst.close();


  %>

<p>product added</p>

<a href="add4.jsp" style="text-decoration:blink;"><b>Add another/Go back</b></a>
</body>
</html>